
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>组件渲染数据定义 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="scriptTmpMixin.html" />
    
    
    <link rel="prev" href="../mixin/calendar.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../../">
            
                <a href="../../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../Chapter1/listRule.html">
            
                <a href="../../Chapter1/listRule.html">
            
                    
                    目录规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    书写规范
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../Chapter1/pug/pugRules.html">
            
                <a href="../../Chapter1/pug/pugRules.html">
            
                    
                    pug规范
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../../Chapter1/pug/pugMixinRules.html">
            
                <a href="../../Chapter1/pug/pugMixinRules.html">
            
                    
                    pug-Mixin定义
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" >
            
                <span>
            
                    
                    css规范
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../../Chapter1/css/publicCss.html">
            
                <a href="../../Chapter1/css/publicCss.html">
            
                    
                    公共css定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../../Chapter1/css/icon.html">
            
                <a href="../../Chapter1/css/icon.html">
            
                    
                    图标定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.3" data-path="../../Chapter1/css/cssAttention.html">
            
                <a href="../../Chapter1/css/cssAttention.html">
            
                    
                    css注意事项
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../../Chapter1/js/jsRules.html">
            
                <a href="../../Chapter1/js/jsRules.html">
            
                    
                    js规范
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    组件定义
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" >
            
                <span>
            
                    
                    定义好的components
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1.1" data-path="../mixin/alert.html">
            
                <a href="../mixin/alert.html">
            
                    
                    alert
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.2" data-path="../mixin/button.html">
            
                <a href="../mixin/button.html">
            
                    
                    button
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.3" data-path="../mixin/form.html">
            
                <a href="../mixin/form.html">
            
                    
                    form
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.4" data-path="../mixin/toast.html">
            
                <a href="../mixin/toast.html">
            
                    
                    toast
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.5" data-path="../mixin/dialog.html">
            
                <a href="../mixin/dialog.html">
            
                    
                    dialog
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.6" data-path="../mixin/navbar.html">
            
                <a href="../mixin/navbar.html">
            
                    
                    navbar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.7" data-path="../mixin/footbar.html">
            
                <a href="../mixin/footbar.html">
            
                    
                    footbar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.8" data-path="../mixin/swiper.html">
            
                <a href="../mixin/swiper.html">
            
                    
                    swiper
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.9" data-path="../mixin/action.html">
            
                <a href="../mixin/action.html">
            
                    
                    action
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.10" data-path="../mixin/popup.html">
            
                <a href="../mixin/popup.html">
            
                    
                    popup
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.11" data-path="../mixin/select.html">
            
                <a href="../mixin/select.html">
            
                    
                    select
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.12" data-path="../mixin/calendar.html">
            
                <a href="../mixin/calendar.html">
            
                    
                    calendar
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.4.2" data-path="mixinData.html">
            
                <a href="mixinData.html">
            
                    
                    组件渲染数据定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="scriptTmpMixin.html">
            
                <a href="scriptTmpMixin.html">
            
                    
                    template定义组件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../.." >组件渲染数据定义</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7EC4;&#x4EF6;&#x6E32;&#x67D3;&#x6570;&#x636E;&#x5B9A;&#x4E49;">&#x7EC4;&#x4EF6;&#x6E32;&#x67D3;&#x6570;&#x636E;&#x5B9A;&#x4E49;</h1>
<p>&#x5728; <code>mixin.pug</code>&#x6216; <code>*.pug</code>&#x4E2D;, &#x6211;&#x4EEC;&#x7ECF;&#x5E38;&#x5B9A;&#x4E49;&#x4E00;&#x4E9B;&#x53D8;&#x91CF;&#x6765;&#x8FDB;&#x884C;for&#x5FAA;&#x73AF;&#x6E32;&#x67D3;;
&#x9488;&#x5BF9;&#x6570;&#x636E;&#x91CF;&#x6570;&#x636E;&#x91CF;&#x8FC7;&#x5927;&#x7684;&#x4FE1;&#x606F;,&#x901A;&#x5E38;&#x6211;&#x4EEC;&#x5728; data&#x6587;&#x4EF6;&#x4E2D;&#x5B9A;&#x4E49;&#x53D8;&#x91CF;;</p>
<hr>
<p>data&#x6587;&#x4EF6;&#x76EE;&#x5F55;&#x5B9A;&#x4E49;:</p>
<blockquote>
<p>src/components/data/<em>.pug
\</em>&#x4E3A;&#x81EA;&#x5B9A;&#x4E49;&#x6587;&#x4EF6;&#x540D;</p>
</blockquote>
<h2 id="&#x5B9A;&#x4E49;">&#x5B9A;&#x4E49;</h2>
<pre><code class="lang-js"><span class="hljs-comment">//  hotelData.pug &#x5982;&#x4E0B;</span>
-
  <span class="hljs-keyword">var</span> facilities = &#x6570;&#x7EC4;/&#x5BF9;&#x8C61;..
</code></pre>
<h2 id="&#x8C03;&#x7528;">&#x8C03;&#x7528;</h2>
<pre><code class="lang-jade">
// hotelProdcutTravel.pug
block content

  include ../../components/data/hotelData  // &#x5728;block content &#x4E0B;&#x5F15;&#x5165; hotelData.pug 

  .gzl-page
    section.gzl-section.detail-section
        ul.hotel-facilities-list
          -for(var i=0;i&lt;facilities.length;i++) // &#x76F4;&#x63A5;&#x8C03;&#x7528;facilities&#x5BF9;&#x8C61;
            li(class=[i&gt;5?&apos;none&apos;:&apos;&apos;])
              +icon(facilities[i].icon)
              p.facilities-name #{facilities[i].name}
</code></pre>
<h2 id="&#x6CE8;&#x610F;">&#x6CE8;&#x610F;</h2>
<p>&#x82E5;&#x6570;&#x636E;&#x8F83;&#x5C11;&#x4E14;&#x590D;&#x7528;&#x6027;&#x8F83;&#x4F4E;&#xFF0C;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x81EA;&#x884C;&#x5B9A;&#x4E49;&#x5728;&#x5BF9;&#x5E94;&#x7684;<code>pug</code>&#x6587;&#x4EF6;&#x5185;&#xFF0C;&#x81EA;&#x884C;&#x53D6;&#x820D;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../mixin/calendar.html" class="navigation navigation-prev " aria-label="Previous page: calendar">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="scriptTmpMixin.html" class="navigation navigation-next " aria-label="Next page: template定义组件">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"组件渲染数据定义","level":"1.4.2","depth":2,"next":{"title":"template定义组件","level":"1.4.3","depth":2,"path":"src/Chapter2/else/scriptTmpMixin.md","ref":"src/Chapter2/else/scriptTmpMixin.md","articles":[]},"previous":{"title":"calendar","level":"1.4.1.12","depth":3,"path":"src/Chapter2/mixin/calendar.md","ref":"src/Chapter2/mixin/calendar.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"src/Chapter2/else/mixinData.md","mtime":"2019-01-24T07:35:36.067Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-01-25T09:10:09.700Z"},"basePath":"../../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../../gitbook/gitbook.js"></script>
    <script src="../../../gitbook/theme.js"></script>
    
        
        <script src="../../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

